class Solution:
    def getAllElements(self,root1: TreeNode, root2: TreeNode) -> List[int]:
        l=[]
        def f(root):
            if root:
                l.append(root.val)
                f(root.right)
                f(root.left)
            f(root1)
            f(root2)
            l.sort()
            return l

            